/**
 * @create 2022-05-02
 * @desc 通过 plugin 调用
 */

const { transformFileSync } = require('@babel/core');
const insertParametersPlugin = require('./plugin/parameters-insert-plugin');
const {getBaseData} = require('../utils/index')
const path = require('path');

const {outputFn} = getBaseData();

const { code } = transformFileSync(path.join(__dirname, './source.js'), {
    plugins: [insertParametersPlugin],
    parserOpts: {
        sourceType: 'unambiguous',
        plugins: ['jsx']
    }
});

outputFn(code);